/*
 *  Copyright 2010 Wesley Gooch, Ryan Nix, Cody Wenzel.
 *  Montana State University - Spring Semester 2010
 *  Computer Science 450 - Compilers
 *  Project: Micro-Pascal Compiler
 */

package msu.compiler.scanner.fsas;

import msu.compiler.scanner.Tokenizer;
import msu.compiler.scanner.Token;

/**
 * FSA to determine a times sign.
 * 
 * @author Cody Wenzel
 */
public class TimesFSA extends FSA {

    public TimesFSA(Tokenizer tokenizer) {
        super(tokenizer);
        initializeStates(2);
    }

    /**
     * Executes the PeriodFSA state machine.
     *
     * @pre     The tokenizer is pointing at a * token and the first
     *          character of this token.
     *
     * @post    The tokenizer is pointing at the first character after
     *          the current token.
     *          A token has been generated.
     *          The token's lexeme contains *
     */
    public void execute() {
        while(notFinished()) {
            switch(getCurrentChar()) {
                case '*':
                    setAcceptState("s1", Token.MP_TIMES);
                    peekAhead(); 
                    break;
                default:
                    fail();
                    break;
            }
        }
        
    }

}
